package model

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(30)" json:"username"`
	Password string `gorm:"type:varchar(60)" json:"password"`
}
type UserRole struct {
	gorm.Model
	Uid int `gorm:"type:int" json:"uid"`
	Rid int `gorm:"type:int" json:"rid"`
}
type Role struct {
	gorm.Model
	RoleName string `gorm:"type:varchar(60)" json:"roleName"`
}
type RoleNode struct {
	gorm.Model
	Rid int `gorm:"type:int" json:"rid"`
	Nid int `gorm:"type:int" json:"nid"`
}
type Node struct {
	gorm.Model
	NodeName string `gorm:"type:varchar(50)"`
}

// 仓库
type Repo struct {
	gorm.Model
	RepCode  string `gorm:"type:varchar(50)" json:"repCode"`  //名字
	RepoName string `gorm:"type:varchar(50)" json:"repoName"` //编码
}

type RepoOrder struct {
	gorm.Model
	RepId      int    `gorm:"type:int" json:"repId"`             //id
	OrderCode  string `gorm:"type:varchar(50)" json:"orderCode"` //编码
	GoodNum    int    `gorm:"Type:int" json:"goodNum"`           //数量
	OrderPrice int    `gorm:"type:int" json:"orderPrice"`        //价格
}

type RepoOrderList struct {
	OrderID    int    `gorm:"type:int" json:"orderID"`
	RepCode    string `gorm:"type:varchar(50)" json:"repCode"`
	RepoName   string `gorm:"type:varchar(50)" json:"repoName"`
	OrderCode  string `gorm:"type:varchar(50)" json:"orderCode"`
	GoodNum    int    `gorm:"Type:int" json:"goodNum"`
	OrderPrice int    `gorm:"type:int" json:"orderPrice"`
}

// 车辆
type Car struct {
	gorm.Model
	CarNo   string `gorm:"type:varchar(50)"` //编号
	CarName string `gorm:"type:varchar(50)"` //名字
	CarCode string `gorm:"type:varchar(50)"` //车牌号
}

type CarOrder struct {
	gorm.Model
	OrderNo   string `gorm:"type:varchar(50)"` //订单号
	OrderFrom string `gorm:"type:varchar(50)"` //发货地
	OrderTo   string `gorm:"type:varchar(50)"` //目的地
	OrderGood string `gorm:"type:varchar(50)"` //订单商品
	Cid       int    `gorm:"type:int"`         //车辆id
}

type CarOrderList struct {
	OrderId   int    `gorm:"type:int"`
	CarNo     string `gorm:"type:varchar(50)"` //编号
	CarName   string `gorm:"type:varchar(50)"` //名字
	CarCode   string `gorm:"type:varchar(50)"` //车牌号
	OrderNo   string `gorm:"type:varchar(50)"`
	OrderFrom string `gorm:"type:varchar(50)"`
	OrderTo   string `gorm:"type:varchar(50)"`
	OrderGood string `gorm:"type:varchar(50)"`
}

// 商品
type Good struct {
	gorm.Model
	GoodCode string `gorm:"type:varchar(50)"`
	GoodName string `gorm:"type:varchar(50)"`
}

type GoodOrder struct {
	gorm.Model
	Gid        int    `gorm:"type:int"`
	OrderCode  string `gorm:"type:varchar(50)"`
	OrderPrice int    `gorm:"type:int"`
}

type GoodOrderList struct {
	OrderId    int    `gorm:"type:int"`
	GoodCode   string `gorm:"type:varchar(50)"`
	GoodName   string `gorm:"type:varchar(50)"`
	OrderCode  string `gorm:"type:varchar(50)"`
	OrderPrice int    `gorm:"type:int"`
}

// 商品订单和售后订单
type PerSon struct {
	gorm.Model
	PerCode  string `gorm:"type:varchar(50)"` //人员编号
	PerName  string `gorm:"type:varchar(50)"` //人员名字
	PerPhone string `gorm:"type:varchar(50)"` //人员手机号
}

type PerSonOrder struct {
	gorm.Model
	OrderCode string `gorm:"type:varchar(50)"` //订单编号
	OrderTO   string `gorm:"type:varchar(50)"` //订单配送地址
	Pid       int    `gorm:"type:int"`         //配送人员id
}

type PerSonOrderList struct {
	OrderId   int    `gorm:"type:int"`
	PerCode   string `gorm:"type:varchar(50)"` //编号
	PerName   string `gorm:"type:varchar(50)"` //名字
	PerPhone  string `gorm:"type:varchar(50)"`
	OrderCode string `gorm:"type:varchar(50)"` //订单编号
	OrderTO   string `gorm:"type:varchar(50)"`
}

// 车辆交易订单
type BigCar struct {
	gorm.Model
	CarCode  string `gorm:"type:varchar(50)"`
	CarName  string `gorm:"type:varchar(50)"`
	CarPrice int    `gorm:"type:int"`
}
type BigCarOrder struct {
	gorm.Model
	OrderCode  string `gorm:"type:varchar(50)"`
	OrderPrice int    `gorm:"type:int"`
	Cid        int    `gorm:"type:int"`
}

type BigCarOrderList struct {
	OrderId    int    `gorm:"type:int"`         //id
	CarCode    string `gorm:"type:varchar(50)"` //订单编码
	CarName    string `gorm:"type:varchar(50)"` //价格
	CarPrice   int    `gorm:"type:int"`         //车辆编码
	OrderCode  string `gorm:"type:varchar(50)"` //名称
	OrderPrice int    `gorm:"type:int"`         //价格
}
